package main

import (
	"fmt"
	"log"
	"os"
	"path/filepath"
)

func main() {
	root := "." // 要遍历的目录，可以更改为你想要遍历的具体路径

	err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
		if err != nil {
			return err
		}
		fmt.Println(path)
		return nil
	})

	if err != nil {
		log.Fatalf("Error walking the path %q: %v\n", root, err)
	}
}
